package com.leyou.item.mapper;

import com.leyou.common.mapper.BaseMapper;
import com.leyou.item.entity.Brand;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @package com.leyou.item.mapper
 * @description: 与数据库进行持久操作的品牌接口
 * @author: 许超越
 * @date 2019/6/25 14:46
 * @version: V1.0
 */
public interface BrandMapper extends BaseMapper<Brand> {

    /**
     *后台新增品牌和类型中间表
     * @param: bid
     * @param: cids
     * @return
     */
    int insertCategoryBrand(@Param("bid") Long bid, @Param("cids") List<Long> cids);

    /**
     * 根据品牌id删除中间表
     * @param id
     * @return
     */
    int deleteIntermediateByBrandId(@Param("id") Long id);


    /**
     * 根据商品分类查询品牌信息
     * @param: cid 商品分类id
     * @return
     */
    List<Brand> queryBrandByCid(@Param("cid") Long cid);
}
